#pragma once

#include <vector>
#include <unordered_map>
#include <memory>
#include "event.h"
namespace TinyRPC{


/**
 * EventManager 是将文件描述符对于的事件注册进来
 */

class EventManager{

public:
    static EventManager& GetInstance();
    void addEventPtr(EventPtr event);
    EventPtr getEventPtr(int fd);
    void delEventPtr(int fd);

private:
    EventManager() {}
private:
    static std::unordered_map<int, std::weak_ptr<Event>> m_eventMap;
};
}
